//
//  RBStockAddOrderSucVC.m
//  zhongzhenglu
//
//  Created by XL on 2022/8/17.
//

#import "RBStockAddOrderSucVC.h"
#import "RBDefine.h"
#import "UIView+RBAdd.h"
#import "UIScrollView+RBAdd.h"
#import <Masonry.h>
#import "RBThemeConfig.h"
#import <UIColor+YYAdd.h>
#import <UIView+YYAdd.h>
#import "RBPager.h"
#import "RanTool.h"
#import "RBGradientView.h"

@interface RBStockAddOrderSucVC ()

@property(nonatomic, strong)UIScrollView *scrollView;

@end

@implementation RBStockAddOrderSucVC

#pragma mark - Lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self setup];
    [self fillData];
}

#pragma mark - Private

- (void)setup
{
    self.title = @"提交成功";
    self.view.backgroundColor = [RBThemeConfig bgGrayColor];
}

- (void)fillData
{
    [self.scrollView rbSetContentWidth:kRBMainScreenWidth];
    [self.scrollView addView:[RanTool imgViewWithMode:0 radius:0 imgName:@"groupDone"] withHeight:Zoom(92) width:Zoom(92) top:Zoom(51) bottom:0 left:CGFLOAT_MIN right:CGFLOAT_MIN centerX:YES];
    [self.scrollView addView:[RanTool labelWithFontSize:Zoom(21) weight:2 color:[RBThemeConfig textBlackColor] align:1 text:@"您已提交加工订单"] withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:Zoom(44) bottom:0 left:0 right:0 centerX:0];
    [self.scrollView addView:[RanTool labelWithFontSize:Zoom(13) weight:0 color:@"454545" align:1 text:@"请及时将口腔数据邮寄给工厂"] withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:Zoom(13) bottom:0 left:0 right:0 centerX:0];
    [self.scrollView addView:({
        UIView *view = UIView.new;
        [view rbSetCornerRadius:Zoom(8)];
        
        RBGradientView *bgView = [RBGradientView gradientViewWithColors:@[[UIColor colorWithHexString:@"#D9E6FF"],UIColor.whiteColor] locations:@[@0, @0.3] vertical:YES];
        [view addSubview:bgView];
        [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.mas_equalTo(0);
        }];
        
        [view view_addView:({
            UIView *view = UIView.new;
            
            [view h_view_addView:[RanTool imgViewWithMode:2 radius:Zoom(6) imgName:@"b1.jpg"] withHeight:Zoom(36) width:Zoom(36) top:0 bottom:0 left:0 right:CGFLOAT_MIN centerY:0];
            
            [view h_view_addView:[RanTool labelWithFontSize:Zoom(15) weight:2 color:[RBThemeConfig textBlackColor] align:0 text:@"环海国际大酒店环海国际大酒店环海国际大酒店环海国际大酒店"] withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:CGFLOAT_MIN bottom:CGFLOAT_MIN left:Zoom(13) right:CGFLOAT_MIN centerY:YES];

            [view h_view_addView:({
                UILabel *view = [RanTool labelWithFontSize:Zoom(12) weight:1 color:UIColor.whiteColor align:1 text:@"复制" bgColor:[RBThemeConfig buttonBlueColor] radius:Zoom(12)];
                [view addPriority:1];
                view;
            }) withHeight:Zoom(24) width:Zoom(57) top:CGFLOAT_MIN bottom:CGFLOAT_MIN left:Zoom(13) right:0 centerY:YES];
            view;
        }) withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:Zoom(15) bottom:0 left:Zoom(12) right:Zoom(12) centerX:0];
        
        [view view_addView:({
            UIView *view = UIView.new;
            [view h_view_addView:[RanTool labelWithFontSize:Zoom(13) weight:1 color:[RBThemeConfig textLightBlackColor] align:0 text:@"收件人"] withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:0 bottom:0 left:0 right:0 centerY:0];
            [view h_view_addView:({
                UILabel *view = [RanTool labelWithFontSize:Zoom(13) weight:2 color:[RBThemeConfig textBlackColor] align:0 text:@"张三"];
                [view addPriority:1];
                view;
            }) withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:0 bottom:0 left:0 right:0 centerY:0];
            view;
        }) withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:Zoom(30) bottom:Zoom(21) left:Zoom(13) right:Zoom(12) centerX:0];
        
        [view view_addView:({
            UIView *view = UIView.new;
            [view h_view_addView:[RanTool labelWithFontSize:Zoom(13) weight:1 color:[RBThemeConfig textLightBlackColor] align:0 text:@"联系方式"] withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:0 bottom:0 left:0 right:0 centerY:0];
            [view h_view_addView:({
                UILabel *view = [RanTool labelWithFontSize:Zoom(13) weight:2 color:[RBThemeConfig textBlackColor] align:0 text:@"1300000000"];
                [view addPriority:1];
                view;
            }) withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:0 bottom:0 left:0 right:0 centerY:0];
            view;
        }) withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:Zoom(15) bottom:Zoom(21) left:Zoom(13) right:Zoom(12) centerX:0];
        
        [view view_addView:({
            UIView *view = UIView.new;
            [view h_view_addView:[RanTool labelWithFontSize:Zoom(13) weight:1 color:[RBThemeConfig textLightBlackColor] align:0 text:@"地址"] withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:0 bottom:0 left:0 right:0 centerY:0];
            [view h_view_addView:({
                UILabel *view = [RanTool labelWithFontSize:Zoom(13) weight:2 color:[RBThemeConfig textBlackColor] align:0 text:@"辽宁省大连市甘井子区水泥路222号"];
                view.numberOfLines = 0;
                [view addPriority:1];
                view;
            }) withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:0 bottom:0 left:0 right:0 centerY:0];
            view;
        }) withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:Zoom(15) bottom:Zoom(21) left:Zoom(13) right:Zoom(12) centerX:0];
        view;
    }) withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:Zoom(39) bottom:0 left:Zoom(15) right:Zoom(15) centerX:0];
    [self.scrollView addView:({
        UIView *view = UIView.new;
        view.backgroundColor = UIColor.whiteColor;
        [view rbSetCornerRadius:Zoom(8)];
        [view view_addView:[RanTool labelWithFontSize:Zoom(14) weight:0 color:[RBThemeConfig textBlackColor] align:0 text:@"您可以直接联系快递公司发件更优惠"] withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:Zoom(19) bottom:0 left:Zoom(13) right:Zoom(13) centerX:0];
        for (NSInteger i = 0; i < 4; i++)
        {
            [view view_addView:[self postViewWithData:nil] withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:Zoom(13) bottom:Zoom(13) left:Zoom(13) right:Zoom(13) centerX:0];
        }
        view;
    }) withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:Zoom(10) bottom:Zoom(10) left:Zoom(15) right:Zoom(15) centerX:0];
}

#pragma mark - Network

#pragma mark - Event

#pragma mark - Setter

#pragma mark - Getter

- (UIScrollView *)scrollView
{
    if (!_scrollView)
    {
        self.scrollView = ({
            UIScrollView *view = UIScrollView.new;
            [self.view addSubview:view];
            [view mas_makeConstraints:^(MASConstraintMaker *make) {
                make.edges.mas_equalTo(0);
            }];
            view;
        });
    }
    return _scrollView;
}

- (UIView *)postViewWithData: (id)data
{
    UIView *view = UIView.new;
    [view rbSetCornerRadius:Zoom(8)];
    [view rbSetBorderWitdh:1 borderColor:[UIColor colorWithHexString:@"#DCDCDC"]];
    
    [view h_view_addView:[RanTool imgViewWithMode:1 radius:0 imgName:@"orderSucPhone"] withHeight:Zoom(23) width:Zoom(23) top:CGFLOAT_MIN bottom:CGFLOAT_MIN left:Zoom(17) right:0 centerY:YES];
    
    [view h_view_addView:({
        UIView *view = UIView.new;
        [view view_addView:[RanTool labelWithFontSize:Zoom(12) weight:0 color:@"#8B8B8B" align:0 text:@"顺丰快递"] withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:0 bottom:0 left:0 right:0 centerX:0];
        [view view_addView:[RanTool labelWithFontSize:Zoom(18) weight:0 color:@"#000000" align:0 text:@"95338"] withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:Zoom(8) bottom:0 left:0 right:0 centerX:0];
        view;
    }) withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:Zoom(13) bottom:Zoom(13) left:Zoom(17) right:0 centerY:0];
    [view h_view_addView:({
        RBGradientView *view = [RBGradientView gradientViewWithColors:@[[UIColor colorWithHexString:@"#FE9B9E"], [UIColor colorWithHexString:@"#FC5876"]] locations:nil vertical:NO];
        [view view_addView:[RanTool labelWithFontSize:Zoom(13) weight:0 color:UIColor.whiteColor align:1 text:@"拨号"] withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:0 bottom:0 left:0 right:0 centerX:0];
        [view rbSetCornerRadius:Zoom(15)];
        view;
    }) withHeight:Zoom(30) width:Zoom(65) top:CGFLOAT_MIN bottom:CGFLOAT_MIN left:Zoom(13) right:Zoom(13) centerY:YES];
    return view;
}

@end
